import request from '@/utils/request'

// 查询用户列表
export function listUser(query) {
  return request({
    url: '/user/user/list',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function getUser(id) {
  return request({
    url: '/user/user/' + id,
    method: 'get'
  })
}

// 新增用户
export function addUser(data) {
  return request({
    url: '/user/user',
    method: 'post',
    data: data
  })
}

// 修改用户
export function updateUser(data) {
  return request({
    url: '/user/user',
    method: 'put',
    data: data
  })
}
// 修改用户余额
export function updateUserAmount(data) {
  return request({
    url: '/user/user/updateUserAmount',
    method: 'post',
    data: data
  })
}

// 发送消息
export function sendUserMsg(data) {
  return request({
    url: '/user/user/sendUserMsg',
    method: 'post',
    data: data
  })
}

// 删除用户
export function delUser(id) {
  return request({
    url: '/user/user/' + id,
    method: 'delete'
  })
}
// 获取聊天记录下载地址
export function getDownloadUrl(date) {
  return request({
    url: '/user/user/getDownloadUrl?date='+date,
    method: 'get'
  })
}
// 获取聊天记录列表
export function fileUploadUrl(date) {
  return request({
    url: '/user/user/fileUploadUrl',
    method: 'post'
  })
}

// 获取发送者用户列表
export function qrySaveData() {
  return request({
    url: '/user/user/qrySaveData',
    method: 'get'
  })
}
// 将用户加入推送列表
export function joinMsgSend(id) {
  return request({
    url: '/user/user/joinMsgSend?id='+id,
    method: 'get'
  })
}
// 更新用户详细地址
export function updAddress(id) {
  return request({
    url: '/user/user/updAddress?id='+id,
    method: 'get'
  })
}

// 将用户加入当前登录账户旗下
export function joinManage(id) {
  return request({
    url: '/user/user/joinManage?id='+id,
    method: 'get'
  })
}
// 将用户加入客服
export function joinCustomer(id) {
  return request({
    url: '/user/user/joinCustomer?id='+id,
    method: 'get'
  })
}

// 移除用户
export function handleDelUser(id) {
  return request({
    url: '/user/user/handleDelUser?id='+id,
    method: 'get'
  })
}
// 加入星期或者删除星期
export function addUserWeek(id,weekType,type) {
  return request({
    url: '/user/user/addUserWeek?id='+id+"&week="+weekType+"&type="+type,
    method: 'get'
  })
}
